<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="content">
        <p>Hello Vue3</p>
        <ul>
            <li>1</li>
            <li>2</li>
            <li>3</li>
        </ul>
    </div>

    <script>
        const content = document.getElementById('content')
        console.log(content.outerHTML) // 返回与div和它的子树相同的节点

        content.outerHTML = "<h1>Hello Vue</h1>" // 这段代码的执行过程如下
        const h1 = document.createElement('h1')
        const textElement = document.createTextNode('Hello Vue3')
        h1.append(textElement)
        document.replaceChild(h1, content)
        
    </script>
</body>
</html>